package com.solocredit.finance.mvp.proxy.act;

import android.os.Bundle;

import com.solocredit.finance.mvp.presenter.MvpPresenter;
import com.solocredit.finance.mvp.proxy.MvpDelegateCallbackProxy;
import com.solocredit.finance.mvp.view.MvpView;

/**
 * MullaFlow
 *
 * @Author wwdeng
 * @CreateTime: 2024/7/24 10:29
 * @Annotation：
 */
public class ActMvpDelegateImpl<V extends MvpView,P extends MvpPresenter<V>> implements ActMvpDelegate<V,P> {

    private MvpDelegateCallbackProxy mvpDelegateCallbackProxy;
    // 具体的目标接口实现类，需要持有创建Mvp实例
    private ActMvpDelegateCallback<V, P> delegateCallback;
    public ActMvpDelegateImpl(ActMvpDelegateCallback<V,P> mvpDelegateCallback){
        this.delegateCallback = mvpDelegateCallback;
        if(mvpDelegateCallbackProxy == null){
            mvpDelegateCallbackProxy = new MvpDelegateCallbackProxy(mvpDelegateCallback);
        }
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        mvpDelegateCallbackProxy.createPresenter();
        mvpDelegateCallbackProxy.attachView();
    }

    @Override
    public void onStart() {

    }

    @Override
    public void onPause() {

    }

    @Override
    public void onResume() {

    }

    @Override
    public void onRestart() {

    }

    @Override
    public void onStop() {

    }

    @Override
    public void onDestroy() {
        mvpDelegateCallbackProxy.detachView();
    }

    @Override
    public void onContentChanged() {

    }

    @Override
    public void onSaveInstanceState(Bundle outState) {

    }

    @Override
    public void onAttachedToWindow() {

    }
}
